#!/usr/bin/make -f
# -*- makefile -*-

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

build: build-stamp
build-stamp:
	dh_testdir
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	dh_clean

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	# Install wfrog executables and default config
	mkdir -p $(CURDIR)/debian/wfrog/usr/lib/wfrog
	mkdir -p $(CURDIR)/debian/wfrog/usr/bin
	mkdir -p $(CURDIR)/debian/wfrog/etc/init.d
	cp -r bin/ wfcommon/ wfdriver/ wflogger/ wfrender/ init.d/ $(CURDIR)/debian/wfrog/usr/lib/wfrog
	ln -s /usr/lib/wfrog/bin/wfrog $(CURDIR)/debian/wfrog/usr/bin/wfrog
	ln -s /usr/lib/wfrog/init.d/wflogger $(CURDIR)/debian/wfrog/etc/init.d/wflogger
	ln -s /usr/lib/wfrog/init.d/wfrender $(CURDIR)/debian/wfrog/etc/init.d/wfrender

	# Prepare data directory
	mkdir -p $(CURDIR)/debian/wfrog/var/lib/wfrog

binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs
	dh_fixperms
	dh_installdeb
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary-arch: build install

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure 
